//
//  Explore.swift
//  OpenSourceChina
//
//  Created by Meng on 15/9/28.
//  Copyright (c) 2015年 Libre Rose. All rights reserved.
//

import Foundation
import UIKit

class Explore : UITableViewController {
    
    override func tableView(tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
        return 23;
    }
    override func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
        return 44;
    }
    
    override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
        let identifier = "Cell"
        var cell = tableView.dequeueReusableCellWithIdentifier(identifier) as? UITableViewCell
        if cell == nil {
            cell = UITableViewCell(style: .Default, reuseIdentifier: identifier)
        }
        switch (indexPath.section) {
        case 0:
            cell?.textLabel?.text = "好友圈";
        case 1:
            cell?.textLabel?.text = ["找人", "活动"][indexPath.row];
        case 2:
            cell?.textLabel?.text = ["扫一扫", "摇一摇"][indexPath.row];
        default:
            break
        }
        return cell!;
    }
    
    override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
        self.tableView .deselectRowAtIndexPath(indexPath, animated: true)
        
        switch (indexPath.section) {
        case 0:
            let event : UIViewController = UIViewController()
            self.navigationController?.pushViewController(event, animated: true)
            break
        case 1:
            let personSearch = UIViewController()
            self.navigationController?.pushViewController(personSearch, animated: true)
            break
        case 2:
            break
        default:
            break
        }
    }
}
